package com.wjy.common.authentication.user.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.wjy.common.base.entity.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.util.Date;

/**
 * <p>
 *
 * </p>
 *
 * @author ybxxszl
 * @since 2019-04-12
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@ApiModel(value = "UserAuthentication对象", description = "")
public class UserAuthentication extends BaseEntity {

    @ApiModelProperty(value = "用户验证ID")
    @TableId(value = "user_authentication_id", type = IdType.UUID)
    private String userAuthenticationId;

    @ApiModelProperty(value = "用户名")
    @TableField("username")
    private String username;

    @ApiModelProperty(value = "密码")
    @TableField("password")
    private String password;

    @ApiModelProperty(value = "角色")
    @TableField("role")
    private String role;

    @ApiModelProperty(value = "是否可用")
    @TableField("enabled")
    private Integer enabled;

    @ApiModelProperty(value = "账号未上锁")
    @TableField("accountNonLocked")
    private Integer accountNonLocked;

    @ApiModelProperty(value = "账号未过期")
    @TableField("accountNonExpired")
    private Integer accountNonExpired;

    @ApiModelProperty(value = "许可未过期")
    @TableField("credentialsNonExpired")
    private Integer credentialsNonExpired;

    @ApiModelProperty(value = "逻辑删除")
    @TableField(value = "logic_delete", fill = FieldFill.INSERT)
    @TableLogic
    private Integer logicDelete;

    @ApiModelProperty(value = "乐观锁")
    @TableField(value = "version", fill = FieldFill.INSERT)
    @Version
    private Integer version;

    @ApiModelProperty(value = "添加人ID")
    @TableField(value = "insert_id", fill = FieldFill.INSERT)
    private String insertId;

    @ApiModelProperty(value = "添加时间")
    @TableField(value = "insert_time", fill = FieldFill.INSERT)
    private Date insertTime;

    @ApiModelProperty(value = "更新人ID")
    @TableField(value = "update_id", fill = FieldFill.UPDATE)
    private String updateId;

    @ApiModelProperty(value = "更新时间")
    @TableField(value = "update_time", fill = FieldFill.UPDATE)
    private Date updateTime;


    public static final String USER_AUTHENTICATION_ID = "user_authentication_id";

    public static final String USERNAME = "username";

    public static final String PASSWORD = "password";

    public static final String ROLE = "role";

    public static final String ENABLED = "enabled";

    public static final String ACCOUNTNONLOCKED = "accountNonLocked";

    public static final String ACCOUNTNONEXPIRED = "accountNonExpired";

    public static final String CREDENTIALSNONEXPIRED = "credentialsNonExpired";

    public static final String LOGIC_DELETE = "logic_delete";

    public static final String VERSION = "version";

    public static final String INSERT_ID = "insert_id";

    public static final String INSERT_TIME = "insert_time";

    public static final String UPDATE_ID = "update_id";

    public static final String UPDATE_TIME = "update_time";

}
